<%@ page language="java" contentType="text/html; charset=UTF8" pageEncoding="UTF8"%>
<%@ include file="/jsp/base/taglibs.jsp"%>
<form action="#" id="edit-form">
<input type="hidden" name="id" value="${travel.id }" />
<table class="table">
	<tr>
		<td>出差人：</td>
		<td colspan="3">
			<input type="text" name="username" value="${travel.username }" />
		</td>
	</tr>
	<tr>
		<td>出差地点：</td>
		<td colspan="3">
			<input type="text" name="addr" value="${travel.addr }"/>
		</td>
	</tr>
	<tr>
		<td>开始时间：</td>
		<td>
			<input type="text" name="startTime" value="<fmt:formatDate value="${travel.startTime }" pattern="yyyy-MM-dd" />"/>
		</td>
		<td>结束时间：</td>
		<td>
			<input type="text" name="endTime" value="<fmt:formatDate value="${travel.endTime }" pattern="yyyy-MM-dd" />" />
		</td>
	</tr>
	<tr>
		<td>原因：</td>
		<td colspan="3">
			<textarea name="reason" style="width:400px;">${travel.reason }</textarea>
		</td>
	</tr>
	<tr>
		<td>交通工具：</td>
		<td>
			<select name="vehicle">
				<option value="个人车辆">个人车辆</option>
				<option value="公司车辆">公司车辆</option>
				<option value="长途车">长途车</option>
				<option value="高铁">高铁</option>
				<option value="飞机">飞机</option>
				<option value="其他">其他</option>
			</select>
		</td>
		<td>类别：</td>
		<td>
			<select name="type">
				<option value="省内">省内</option>
				<option value="省外">省外</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>出差费用：</td>
		<td colspan="3">
			<input type="text" name="cost" value="${travel.cost }"/>
		</td>
	</tr>
	<tr>
		<td>审批人：</td>
		<td colspan="3">
			<input type="text" name="viewer" value="${travel.viewer }"/>
		</td>
	</tr>
	<tr>
		<td>短信提醒：</td>
		<td colspan="3">
			<input type="checkbox" name="send" value="1" />&nbsp;<span>短信提醒</span>
		</td>
	</tr>
		 
	<tr>
		<td colspan="4" align="center">
			<a href="javascript:void(0)" class="btn btn-primary  " onclick="update()" >保存</a>
			<a href="javascript:void(0)" class="btn btn-default " onclick="closeModal()">取消</a>
		</td>
	</tr>
</table>
</form>
<script>
$(function() {
	var vehicle = "${travel.vehicle}";
	$("#edit-form select[name=vehicle]").val(vehicle);
	
	var type = "${travel.type}";
	$("#edit-form select[name=type]").val(type);
	
	var send = "${travel.send}";
	if(send == 1) {
		$("#edit-form input[name=send]").prop("checked", "checked");
	} else {
		$("#edit-form input[name=send]").removeProp("checked");
	}
	
})
</script>
